<!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

	<meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1,user-scalable=no">
	<meta name="format-detection" content="telephone=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<link href="/css/sign_css/index.css" rel="stylesheet" type="text/css">
	<link href="/css/sign_css/lrtk.css" rel="stylesheet" type="text/css">
	<link href="/css/sign_css/special_12.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="/js/plugins/jquery/jquery.min.js"></script>
	<script type="text/javascript" src="/js/sign_js/lrtk.js"></script>
	<script src="/js/plugins/jrender/jrender.min.js"></script>
	<link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">
	<script src="/js/plugins/dialog2/dialog.min.js"></script>
	<link rel="stylesheet" href="/js/plugins/bootstrap-4.1.1-dist/css/bootstrap.min.css">
	<link rel="stylesheet" href="/css/sign_css/style.css">

	<title>我的积分详情</title>
	<style>
		body{
			background: #e8003a;
			padding:0; margin:0;
		}
		.clearfix{ clear:both;}
		.select_container{ width:100%; border-bottom:solid 1px #cdcdcd; background:white;}
		.select_container li{ width:50%; float:left; border-right :solid 1px #cdcdcd; line-height:30px; font-size:16px; color:#1a1a1a; margin:2% 0;}
		.select_box{ width:100%; background:#fff;}
		.select_content{ width:auto;}
		.select_content li{ width:90%; margin:0 auto; line-height:30px; color:#1a1a1a; font-size:14px;}
		.select_content li img{ float:left;}
		.select_content li label{ float:left; margin-left:10px;}
	</style>
	<script>
		$(function () {
			//总积分
			var totalScore;
			var count =0;
			var signtime ="你還沒有簽到過哦"
            $('#signtime').html(signtime);
			//查询我的签到积分(最新签到信息)
            $.get('/signs', function (data) {
                $('#myInfo').renderValues(data);
                totalScore = data.result.signScore;
                //给总积分赋值
                $('#totalScore').html("<b>"+totalScore+"</b>");
            })
                //根据昨天的续签count判断今天可以领取多少积分
                $.get('/signs/yesterdayCount', function (data) {
                    console.log(data);
                    if(data.success) {
                        if (data.result >= 2 && (data.result + 1) % 3 == 0) {
                            $('#todayScore').html(12);
                        } else if (data.result >= 1 && (data.result + 1) % 3 !=0) {
                            $('#todayScore').html(2);
                        }else{
                            $('#todayScore').html(1);
						}
                    }
                    $('.count').renderValues(data);
                    //给连续签到天数赋值
                    count = data.result;
                    console.log(count);
                })

			//签到总天数
			$.get("/signs/userId", function (data){
                $('#allCount').renderValues(data);
			})

			//今天已领积分
            $.get("/signs/getSignByToday", function (data){
                console.log(data);
                if(data.result==null){
                    $('#getScore').html(0);
				}else{
                    $('#getScore').html(data.result.signState);
				}

            })

        })

	</script>

</head>
<body id="scoll_d" style="background-color: transparent;">
<header>
	<div id="gduo" class="top" style="height:50px;">
		<font class="title">我的积分详情</font>
		<a href="javascript:history.back()" class="return">
			<img src="http://pgf7k79ux.bkt.clouddn.com/gd_black.png"></a>
		<span class="gwc_img">
		    <a href="/index.html" class="ret_home"><img src="http://pgf7k79ux.bkt.clouddn.com/gg_home.png"></a>
        </span>

	</div>
</header>

<div class="container">
	<div class="row">
		<div class="col-xs-12 clearPadding">
			<div class="plr10 pb10 ">
				<div class="ptitle">
					<div class="pull-right font14"><b>当前总积分</b> : <span class="text-red" id="totalScore"><b></b></span></div>
				</div>
				<div class="pline"></div>
				<div class="prizebox pt10">
					<div class="prizelist">
						<div id="myInfo">
						<div class="clearfix pb10">
							<div class="col-xs-8 clearPadding font14 count">
								当前续签天数 : <span render-html="result"></span>
							</div>
						</div>
						<div class="clearfix pb10">
							<div class="col-xs-8 clearPadding font14">
								最近签到时间 : <span render-html="result.signTime" id="signtime"></span>
							</div>
						</div>
						<div class="clearfix pb10">
							<div class="col-xs-8 clearPadding font14">
								今天可领积分 : <span id="todayScore"></span>
							</div>
						</div>
						<div class="clearfix pb10">
							<div class="col-xs-8 clearPadding font14">
								今天已领积分 : <span id="getScore"></span>
							</div>
						</div>
						</div>

						<div class="clearfix pb10" id="allCount">
							<div class="col-xs-8 clearPadding font14">
								总签到天数 : <span render-html="result"></span>
							</div>
						</div>

					</div>
				</div>
				<div class="col-xs-8 clearPadding font16 text-center">
				<button class="btn text-white" style="background: #19800a;">
					<a href="http://localhost/mine/changeList.html"><b>查看我已兑换商品</b></a>
				</button>
				</div>
			</div>
			<div class="turRule">
				<div class="clearfix text-brown">
					<div class="col-xs-4 clearPadding" style="position:relative;"><span class="ball ball1"></span><div class="line"></div></div>
					<div class="col-xs-4 clearPadding text-center font16">积分获取规则</div>
					<div class="col-xs-4 clearPadding" style="position:relative;"><div class="line"></div><span class="ball ball2"></span></div>
				</div>
				<div class="mt10">
					<dl>
						<dt><span class="">1</span><strong>签到送积分</strong></dt>
						<dd class="font14">签到即可获取1积分</dd>
						<dd class="font14">连续签到可获取2积分,若中途断签,则重新计算续签天数</dd>
						<dd class="font14">每连续签到3天,可获得额外10积分奖励</dd>
					</dl>
					<dl>
						<dt><span class="">2</span><strong>活动声明</strong></dt>

						<dd class="font14">本活动最终解释权归商家所有</dd>
					</dl>										
				</div>
			</div>
			<div class="plr15 clearPadding">
				<div class="col-xs-6 text-center">
					<a href="http://localhost/mine/profiles.html">
						<button class="btn btn-block text-white" style="background: #19800a;">去签到</button></a>
				</div>

				<div class="col-xs-6 text-center">
					<a href="javascript:history.back()" class="return">
						<button class="btn btn-block text-white" style="background:#da2608;">返回</button></a>
				</div>
			</div>
		</div>
	</div>
</div>    
</body>
</html>